package com.qing.demo.netty.redis.config;

import com.alibaba.fastjson.support.spring.FastJsonRedisSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * @author caozhipeng
 * @date 2025/8/7
 */
@Configuration
public class PublisherConfig {


    @Bean
    public RedisTemplate<String,Object> redisMessageTemplate(RedisConnectionFactory connectionFactory){
        RedisTemplate<String,Object> redisTemplate=new RedisTemplate<>();
        redisTemplate.setConnectionFactory(connectionFactory);
        redisTemplate.setDefaultSerializer(new FastJsonRedisSerializer<Object>(Object.class));
        return redisTemplate;
    }



}
